#include "MyQtAppl.h"
#include <QTabBar>
#include <QDebug>

MyQtAppl::MyQtAppl(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
    ui.tabWidget->tabBar()->hide();
    connect(ui.toolButton1, &QToolButton::clicked, [=] {
        ui.toolButton1->setChecked(true);
        ui.toolButton2->setChecked(false);
        qDebug() << "btn1:" << ui.toolButton1->property("accessCode");
    });
    connect(ui.toolButton2, &QToolButton::clicked, [=] {
        ui.toolButton1->setChecked(false);
        ui.toolButton2->setChecked(true);
        qDebug() << "btn1:" << ui.toolButton2->property("accessCode");
    });
}

MyQtAppl::~MyQtAppl()
{}

void MyQtAppl::on_toolButton1_clicked()
{
    ui.tabWidget->setCurrentIndex(0);
}

void MyQtAppl::on_toolButton2_clicked()
{
    ui.tabWidget->setCurrentIndex(1);
}